#include <stdio.h>
#include <string.h>

#define HASH_MATH	hash = (hash << 5) + hash + (unsigned long)src[i]

unsigned long time33(const char *src, unsigned int len);
unsigned long time33_ex(const char *src, unsigned int len);
int main(int argc, char **argv)
{
	char *s = "hello";
	if(argc > 1) 
	{
		s = argv[1];
	}

	unsigned long value = time33(s, strlen(s));
	unsigned long value_ex = time33_ex(s, strlen(s));
	printf("key: %s, value: %lu  value1: %lu \r\n", s, value, value_ex);

	return 0;
}

unsigned long time33(const char *src, unsigned int len)
{
	int i = 0;
	unsigned long hash = 0;
	for(;i < len; i++)
	{
		hash = hash * 33 + (unsigned long)src[i];	
	}

	return hash;
}


unsigned long time33_ex(const char *src, unsigned int len)
{
	int i = 0;
	unsigned long hash = 0;
	for(;i < len; i++)
	{
		hash = (hash<<5) + hash + (unsigned long)*src++;
	}
	
	return hash;
}

unsigned long time33_f(const char *src, unsigned int len)
{
	int i = 0;
	unsigned long hash = 5831;

	for(;i < len; i= i +8)
	{
	}
}
